package dao;

import java.util.Date;

import org.hibernate.Query;

public class SupportDAOImpl extends SupportDAO {

    public int getTodaySupportCount(String supporter, Date today) {
        String sql = "select count(support_id) from support where supporter = ? and support_date = ?";
        Query query = getCurrentSession().createSQLQuery(sql).setString(0, supporter).setDate(1, today);
        return  ((Number) query.uniqueResult()).intValue();
    }

}
